<?php
defined('IN_IXDCW') or exit('Access Denied');
include tpl('header');
show_menu($menus);
?>
	<form method="post" action="?" id="dform" onsubmit="return check();">
		<input type="hidden" name="moduleid" value="<?php echo $moduleid; ?>"/>
		<input type="hidden" name="file" value="<?php echo $file; ?>"/>
		<input type="hidden" name="action" value="<?php echo $action; ?>"/>
		<input type="hidden" name="itemid" value="<?php echo $business['itemid']; ?>"/>
		<input type="hidden" name="forward" value="<?php echo $forward; ?>"/>

		<div class="tt">审核店铺信息</div>
		<table cellpadding="2" cellspacing="1" class="tb">
			<tr>
				<td class="tl">审核商家信息</td>
				<td class="tr verify_check">
					<button data-url="?moduleid=<?php echo $moduleid; ?>&file=<?php echo $file; ?>&itemid=<?php echo $business['itemid']; ?>&action=setInfoStatus&verify=3"
					        <?php if ($business['status'] != 3) {
					        ; ?>class="btn" <?php }else{ ?>class="btn disabled"<?php } ?>
						> 通 过
					</button>
					&nbsp;&nbsp;&nbsp;&nbsp;
					<button data-url="?moduleid=<?php echo $moduleid; ?>&file=<?php echo $file; ?>&itemid=<?php echo $business['itemid']; ?>&action=setInfoStatus&verify=2"
					        <?php if ($business['status'] != 2) {
					        ; ?>class="btn" <?php }else{ ?>class="btn disabled"<?php } ?>
						> 未审核
					</button>
					&nbsp;&nbsp;&nbsp;&nbsp;
					<button data-url="?moduleid=<?php echo $moduleid; ?>&file=<?php echo $file; ?>&itemid=<?php echo $business['itemid']; ?>&action=setInfoStatus&verify=1"
					        <?php if ($business['status'] != 1) {
					        ; ?>class="btn" <?php }else{ ?>class="btn disabled"<?php } ?>
						> 拒 绝
					</button>
				</td>
			</tr>
			<script>
				seajs.use(['easyui', 'easyui-css'], function () {
					$(function(){
						$('.verify_check button').on('click', function (data) {
							var dataUrl = $(this).attr('data-url');
							$.post(dataUrl, function (data) {
								console.log(data);
								$.messager.show({
									title : '提示',
									msg : data
								})
							});
							setInterval("window.location.reload()", 2000);
							return false;
						})
					})
				})
			</script>
			<tr>
				<td class="tl"><span class="f_red">*</span> 商家名称</td>
				<td class="tr"><?php echo $business['shopname']; ?></td>
			</tr>
			<?php if (!$business['mainstore']) { ?>
				<tr>
					<td class="tl"><span class="f_red">*</span>分店名称</td>
					<td class="tr"><?php echo $business['nickname']; ?></td>
				</tr>
			<?php } ?>
			<tr>
				<td class="tl"><span class="f_red">*</span> 营业执照</td>
				<td class="tr">
					<?php if ($businessAuth['license_url']) { ?>
						<img src="<?php echo $businessAuth['license_url']; ?>" width="120" alt="">
						<a href="<?php echo $businessAuth['license_url']; ?>" target="_blank">[查看大图]</a>
					<?php } else { ?>
						暂未上传
					<?php } ?>
					<br>
				</td>
			</tr>
			<tr>
				<td class="tl">审核营业执照</td>
				<td class="tr verify_check">
					<button data-url="?moduleid=<?php echo $moduleid; ?>&file=<?php echo $file; ?>&action=setLicenseStatus&licenseStatus=3&aUserid=<?php echo $businessAuth['userid']; ?>"
					        <?php if ($businessAuth['license_status'] != 3) {
					        ; ?>class="btn" <?php }else{ ?>class="btn disabled"<?php } ?>
						> 通 过
					</button>
					&nbsp;&nbsp;&nbsp;&nbsp;
					<button data-url="?moduleid=<?php echo $moduleid; ?>&file=<?php echo $file; ?>&action=setLicenseStatus&licenseStatus=2&aUserid=<?php echo $businessAuth['userid']; ?>"
					        <?php if ($businessAuth['license_status'] != 2) {
					        ; ?>class="btn" <?php }else{ ?>class="btn disabled"<?php } ?>
						> 待审核
					</button>
					&nbsp;&nbsp;&nbsp;&nbsp;
					<button data-url="?moduleid=<?php echo $moduleid; ?>&file=<?php echo $file; ?>&action=setLicenseStatus&licenseStatus=1&aUserid=<?php echo $businessAuth['userid']; ?>"
					        <?php if ($businessAuth['license_status'] != 1) {
					        ; ?>class="btn" <?php }else{ ?>class="btn disabled"<?php } ?>
						> 拒 绝
					</button>
				</td>
			</tr>
			<tr>
				<td class="tl"><span class="f_red">*</span> 形象图片</td>
				<td class="tr">
					<?php if ($business['thumb']) { ?>
						<img src="<?php echo $business['thumb']; ?>" width="120" alt="">
						<a href="<?php echo $business['thumb']; ?>" target="_blank">[查看大图]</a>
					<?php } else { ?>
						暂未上传
					<?php } ?>
				</td>
			</tr>
			<tr>
				<td class="tl"><span class="f_red">*</span> 商家类别</td>
				<td class="tr">
					<?php echo Post::cateCombo('post[catid]', $business['catid'], 33, '', '', 9); ?>
				</td>
			</tr>
			<tr>
				<td class="tl"><span class="f_red">*</span> 详细地址</td>
				<td class="tr">
					<?php echo Post::areaCombo('post[areaid]', $business['areaid'], '', '', $moduleid, '', true) ?> <br>
					<input style="margin-top: 10px;" class="easyui-validatebox" data-options="required:true,validType:['length[3,50]'],missingMessage:'请输入详细地址!'" name="post[address]" disabled="disabled" type="text" size="50" value="<?php echo $business['address']; ?>"/>
				</td>
			</tr>
			<tr>
				<td class="tl"><span class="f_red">*</span> 联系电话</td>
				<td class="tr">
					<input class="easyui-validatebox" data-options="required:true,missingMessage:'请输入联系电话!'" name="post[tel1]" type="text" size="30" disabled="disabled" value="<?php echo $business['tel1'] ?>"/>
					<input disabled="disabled" name="post[tel2]" type="text" size="30" value="<?php echo $business['tel2'] ?>"/>
				</td>
			</tr>
			<tr>
				<td class="tl"><span class="f_red">*</span> 经营项目</td>
				<td class="tr">
					<textarea disabled="disabled" name="post[business]" style="width: 400px;height: 50px;"><?php echo $business['business']; ?></textarea>
				</td>
			</tr>
			<tr>
				<td class="tl"><span class="f_red">*</span> 优惠折扣</td>
				<td class="tr">
					<textarea disabled="disabled" name="post[youhui_zhekou]" style="width: 400px;height: 25px;"><?php echo $business['youhui_zhekou']; ?></textarea>
				</td>
			</tr>
			<tr>
				<td class="tl">优惠提示</td>
				<td class="tr">
					<textarea disabled="disabled" name="post[youhui_tishi]" style="width: 400px;height: 25px;"><?php echo $business['youhui_tishi']; ?></textarea>
				</td>
			</tr>
			<tr>
				<td class="tl">停车场位置</td>
				<td class="tr">
					<textarea disabled="disabled" name="post[carstop]" style="width: 400px;height: 50px;"><?php echo $business['carstop']; ?></textarea>
				</td>
			</tr>
			<tr>
				<td class="tl"><span class="f_red">*</span>详细信息</td>
				<td class="tr">
					<div style="height: 400px;overflow: scroll;">
						<?php echo $businessData['content']; ?>
					</div>
				</td>
			</tr>
			<tr>
				<td class="tl">我的位置</td>
				<td class="tr">
					<input type="text" disabled="disabled" id="point" name="post[zuobiao]" value="<?php echo $business['langitude'] . ',' . $business['latitude']; ?>"/>
				</td>
			</tr>
		</table>
	</form>
	<script type="text/javascript">Menuon(0);</script>
<?php include tpl('footer'); ?>